home *** CD-ROM | disk | FTP | other *** search
- Path: chewy.vcx.net!usenet
- From: Bruce Arnold <barnold@vcx.net>
- Newsgroups: comp.lang.c
- Subject: Re: Problem with stringcopy
- Date: Mon, 08 Jan 1996 01:11:03 -0800
- Organization: Sprint United Telephone/Eastern - Internet @ccess
- Message-ID: <30F0DFA7.1D11@vcx.net>
- References: <4clguu$9fs@eagle.novo.dk> <yewvimppjz5.fsf@hyll.idt.unit.no> <4cmafq$bm5@clarknet.clark.net> <4co4mk$1pqi@news.gate.net>
- NNTP-Posting-Host: y-wing-2a-1.tatooine.vcx.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b2a (Windows; I; 16bit)
-
- > In article <4cmafq$bm5@clarknet.clark.net>,
- > eamick@clark.net (Eric Amick) wrote:
- > >Amund Tveit (amundt@pvv.unit.no) wrote:
- > >>[Morten Brun]
- > >>| How do i do a partial stringcopy ....
- .......
- > strncpy(destination,&source[startpos],max_length);
- .......
- The above solution looks good but don't forget that strncpy() doesn't
- terminate the string with a null in all cases. Therefore an extra
- statement is required: destination[max_length] = 0;
-
- Bruce.
-